/**
 * 
 */
package com.mindtree.vi.presentation.servlet;

import com.mindtree.vi.business.questionsubmission.QuestionManager;
import com.mindtree.vi.dbaccess.datatypes.problem.Problem;
import com.mindtree.vi.presentation.annotation.ReferencedBy;
import com.mindtree.vi.presentation.annotation.RequestParam;
import com.mindtree.vi.xml.XmlResponse;

/**
 * @author m1005309
 *
 */
public class ReviewCodeServlet extends BaseHttpServlet {

	@RequestParam("problemId")
	private long problemId;
	
	@ReferencedBy("questionManager")
	private QuestionManager questionManager;
	
	@Override
	public void process() {
		Problem problem = questionManager.findQuestion(problemId); 
		 boolean approved = questionManager.approveQuestion(problem);
		 XmlResponse response = new XmlResponse();
		 response.setMessage(approved?"T":"F");
		 setResponse(response);
	}

}
